#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>

// --------------------------------------------------------------------------------
// Given P as a prime, represent 2^P - 1 in base-10.
// Using uint32_t as the basic representation, needs P bits in N bytes.
// The least M bits of the most significant 32-bit are 1.
// Up to L digits needed in base-10 representation.
//
// Written by lyazj <seeson@pku.edu.cn>.
// --------------------------------------------------------------------------------

#define P 19937
#define N ((P + 31) >> 5)  // i.e. (int)ceil(P / 32.0)
#define M (P & 31)         // i.e. P % 32
#define L ((int)ceil(P * log(2) / log(10)))

// Track how many 32-bit's remain in successive divisions.
size_t nb32 = N;

uint32_t divmod(uint32_t num[N], uint32_t d)
{
  uint64_t rem = 0;
  bool zero_flag = 1;
  for(size_t i = nb32; i > 0; --i) {
    rem <<= 32;
    rem += num[i - 1];
    num[i - 1] = rem / d;
    rem %= d;
    if(zero_flag) num[i - 1] ? zero_flag = 0 : --nb32;
  }
  return rem;
}

int main(void)
{
  // Generate 2^19937 - 1.
  uint32_t num[N];
  memset(num, -1, sizeof num - sizeof *num);
  num[N - 1] = ((uint32_t)1 << M) - 1;

  // Perform Base-10.
  char s[L], *p = s;
  while(nb32) *p++ = divmod(num, 10) + '0';

  // Output.
  while(p > s) putchar(*--p);
  putchar('\n');
  return 0;
}
